﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;
using KBS8.Shared;

namespace KBS8.Presentation.MapView.DrawHandler
{
    public class GrassDrawHandler : DrawHandler
    {
        public GrassDrawHandler()
        {
            this.Pen = new Pen(new SolidColorBrush(MapStyle.Grass), 1);
        }

        /// <summary>
        /// Handles map data or passes it on to another DrawHandler
        /// </summary>
        /// <param name="data">The map data to handle</param>
        /// <param name="dc"></param>
        public override void Handle(MapTile data, ref DrawingContext dc)
        {
            Rect rect = new Rect(0, 0, data.rec.Height, data.rec.Width);
            dc.DrawRectangle(new SolidColorBrush(MapStyle.Grass), (Pen)null, rect);
            
            if (Successor != null)
                Successor.Handle(data, ref dc);
        }
    }
}
